<?php

if(!defined('ADMIN')){
	exit('Access Denied');
}

if(isset($_GET["id"])){ $_POST['ids']=$_GET["id"];}

$id_arr=$_POST['ids'];

if(!empty($id_arr)){
    if(!is_array($id_arr)){
        $id_arr1[]=$id_arr;
    }else{
        $id_arr1=$id_arr;
    }
    foreach($id_arr1 as $id){
        $tlist=$ezhand->select("thread t,model m","m.tablename,t.modelid","t.modelid=m.id and t.id=".$id);
        $tablename=$tlist["tablename"];
        $modelid=$tlist["modelid"];
        if(!empty($tablename)){
            $ezhand->delete($tablename,'tid="'.$id.'"');
            if($modelid>0){
                $uinfo =array ('f' => 'num','e' => '-','v' =>1);
                $ezhand->update("model",$uinfo,'id="'.$modelid.'"');
            }
                     
        }
    }
    $re=$ezhand->delete_id_in(implode(",",$id_arr1),"thread");

}
if($re==1){
    jumpajax('200','内容删除完成','');
}
else{
    jumpajax('300','内容删除错误','');
}
?>